<template>
  <div class="home">
    <!-- <h1>{{this.$store.state.counter}}</h1> -->
    <h1>{{counter}}</h1>
    <!-- <button @click="editName">修改name</button> -->
    <button @click="editNameA('lisi')">修改name</button>
  </div>
</template>

<script>
  import {
    mapActions,
    mapState
  } from 'vuex'
  export default {
    name: 'HomeView',
    computed: {
       /* counter(){
         return this.$store.state.counter
       } */
       ...mapState(['counter'])
    },
    methods: {
      /* editName() {
         this.$store.dispatch('editNameA', 'lisi');
       } */
      ...mapActions(['editNameA'])
    }
  }
</script>
